package com.dhy.controller;

import com.dhy.beans.ClassscheduleClasssplit;
import com.dhy.service.ClassscheduleClasssplitService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("/courseTable")
@Api(tags = "课程数据请求API获取")
public class CourseController
{
    @Resource
    private ClassscheduleClasssplitService classscheduleClasssplitService;

    //获取所有课程数据
    @GetMapping("/courses")
    @ApiOperation("获取所有的课程数据")
    @Cacheable(value = "coursesData")
    public List<ClassscheduleClasssplit> get_courses_data()
    {
       return classscheduleClasssplitService.list();
    }
}
